home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Arsenal Files 6
/
The Arsenal Files 6 (Arsenal Computer).ISO
/
prg_basi
/
ddfedit.zip
/
DDFNWIDX.FRM
< prev
next >
Wrap
Text File
|
1996-02-05
|
9KB
|
311 lines
VERSION 2.00
Begin Form FormNewIndex
BackColor = &H00C0C0C0&
BorderStyle = 1 'Fixed Single
Caption = "Add New Index"
ClientHeight = 1860
ClientLeft = 2955
ClientTop = 3690
ClientWidth = 4380
ControlBox = 0 'False
Height = 2265
Left = 2895
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1860
ScaleWidth = 4380
Top = 3345
Width = 4500
Begin SSPanel Panel3D1
AutoSize = 3 'AutoSize Child To Panel
BevelInner = 1 'Inset
BevelOuter = 0 'None
BorderWidth = 1
Caption = "Panel3D1"
Height = 375
Left = 45
TabIndex = 20
Top = 45
Width = 4245
Begin ComboBox FieldList
Height = 315
Left = 30
Style = 2 'Dropdown List
TabIndex = 21
Top = 30
Width = 4185
End
End
Begin CommandButton ButOk
Caption = "OK"
Default = -1 'True
Height = 330
Left = 3060
TabIndex = 19
Top = 1440
Width = 1230
End
Begin CommandButton butcan
Cancel = -1 'True
Caption = "Cancel"
Height = 330
Left = 1665
TabIndex = 18
Top = 1440
Width = 1230
End
Begin TextBox XFDid
Height = 285
Left = 315
TabIndex = 17
Top = 1440
Visible = 0 'False
Width = 180
End
Begin TextBox XFDName
Height = 285
Left = 570
TabIndex = 16
Top = 1440
Visible = 0 'False
Width = 180
End
Begin TextBox XFDLocation
Height = 285
Left = 810
TabIndex = 15
Top = 1440
Visible = 0 'False
Width = 180
End
Begin TextBox XFDFlags
Height = 285
Left = 1035
TabIndex = 14
Top = 1440
Visible = 0 'False
Width = 180
End
Begin TextBox XPath
Height = 285
Left = 90
TabIndex = 13
Top = 1440
Visible = 0 'False
Width = 180
End
Begin TextBox IndexIdx
Height = 285
Left = 1260
TabIndex = 12
Top = 1440
Visible = 0 'False
Width = 180
End
Begin TextBox IndexNewPart
Height = 285
Left = 1530
TabIndex = 11
Top = 1440
Visible = 0 'False
Width = 180
End
Begin SSFrame Frame3D1
Caption = "Key Flags"
ForeColor = &H00000000&
Height = 825
Left = 45
TabIndex = 0
Top = 495
Width = 4245
Begin SSCheck KeyFlag
Caption = "MAN"
Height = 195
Index = 9
Left = 3330
TabIndex = 10
Top = 495
Width = 825
End
Begin SSCheck KeyFlag
Caption = "EXT"
Height = 195
Index = 8
Left = 2520
TabIndex = 9
Top = 495
Value = -1 'True
Width = 825
End
Begin SSCheck KeyFlag
Caption = "SUP"
Height = 195
Index = 7
Left = 1710
TabIndex = 8
Top = 495
Width = 825
End
Begin SSCheck KeyFlag
Caption = "DEC"
Height = 195
Index = 6
Left = 900
TabIndex = 7
Top = 495
Width = 825
End
Begin SSCheck KeyFlag
Caption = "SEQ"
Height = 195
Index = 5
Left = 90
TabIndex = 6
Top = 495
Width = 825
End
Begin SSCheck KeyFlag
Caption = "SEG"
Height = 195
Index = 4
Left = 3330
TabIndex = 5
Top = 270
Width = 825
End
Begin SSCheck KeyFlag
Caption = "NULL"
Height = 195
Index = 3
Left = 2520
TabIndex = 4
Top = 270
Width = 825
End
Begin SSCheck KeyFlag
Caption = "BIN"
Height = 195
Index = 2
Left = 1710
TabIndex = 3
Top = 270
Width = 825
End
Begin SSCheck KeyFlag
Caption = "MOD"
Height = 195
Index = 1
Left = 900
TabIndex = 2
Top = 270
Width = 825
End
Begin SSCheck KeyFlag
Caption = "DUP"
Height = 195
Index = 0
Left = 90
TabIndex = 1
Top = 270
Width = 825
End
End
End
Option Explicit
'Type XDIndex_def
' XiDFile As Integer ' File ID (XfDid in FILE.DDF Above)
' XiDField As Integer ' Filed ID (XeDid in FILED.DFF above)
' XiDNumber As Integer ' Key Number (0-->)
' XiDPart As Integer ' Key Part (Segment of above, from 0-->)
' XiDFlags As Integer ' Flags of Key
'End Type
' XiDFlags can be :
' K_DUP = 1
' K_MOD = 2
' K_BIN = 4
' K_NUL = 8
' K_SEG = 16
' K_SEQ = 32
' K_DEC = 64
' K_SUP = 128
' K_EXT = 256
' K_MAN = 512
Sub butcan_Click ()
Unload Me
End Sub
Sub ButOk_Click ()
Dim NewIndexNumber As Integer
Dim i As Integer
Dim FormID As Integer
Dim nid As Integer
Dim npart As Integer
Dim Flags As Integer
Dim FieldID As Integer
' what's he doing
' look at IndexId, and IndexNewPart
' is it :
' A completely new index then
' IndexId = -1
' A New Part to an index then
' IndexId is the line on the list
' IndexNewPart=1
' Editing an Index then
' IndexId is the line on the list
' IndexNewPart=0
FormID = -1
For i = 0 To Forms.Count - 1
If Forms(i).Tag = "D" & Trim(xfdid.Text) Then
FormID = i
Exit For
End If
Next i
If FormID = -1 Then
MsgBox "ERROR : Can't find parent form"
Exit Sub
End If
nid = Val(IndexIdx.Text)
npart = Val(IndexNewPart.Text)
Flags = 0
For i = 0 To 9
If KeyFlag(i).Value Then Flags = Flags + 2 ^ i
Next i
If nid = -1 Then ' a completely new index !
Forms(FormID).Llist.AddItem Format(999, "0") & Chr(9) & "0" & Chr(9) & Format(FieldList.ItemData(FieldList.ListIndex), "0") & Chr(9) & FieldList.List(FieldList.ListIndex) & Chr(9) & Format(Flags, "0")
Else
If npart = 0 Then ' He's editing
FieldID = Forms(FormID).Llist.ItemData(nid)
Forms(FormID).Llist.RemoveItem nid
Forms(FormID).Llist.AddItem Format(FieldID, "0") & Chr(9) & "0" & Chr(9) & Format(FieldList.ItemData(FieldList.ListIndex), "0") & Chr(9) & FieldList.List(FieldList.ListIndex) & Chr(9) & Format(Flags, "0"), nid
Else ' Its a New Part to the index
FieldID = Forms(FormID).Llist.ItemData(nid)
Forms(FormID).Llist.AddItem Format(FieldID, "0") & Chr(9) & "0" & Chr(9) & Format(FieldList.ItemData(FieldList.ListIndex), "0") & Chr(9) & FieldList.List(FieldList.ListIndex) & Chr(9) & Format(Flags, "0"), nid + 1
End If
End If
Curr_File_changed = True
Unload Me
End Sub
Sub Form_Load ()
left = (screen.Width - Width) / 2
top = (screen.Height - Height) / 2
End Sub